package com.example.demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

@Controller
@RequestMapping("/user1")
public class UserController2 {
    @RequestMapping("/index")
    public Object reIndex() {
        return "/index.html";
    }
    @RequestMapping("/text")
    @ResponseBody
    public String reText() {
        return "<h1>HEllo!,MMMLL</h1>";
    }

    @RequestMapping("/json")
    @ResponseBody
    public HashMap<String,String> reJson() {
        HashMap<String,String> map = new HashMap<>();
        map.put("JAVA","NB");
        map.put("MYSQL","NB");
        map.put("SPRING","NB");
        return map;
    }
}
